#include <iostream>
#include <algorithm>
#include <string>
using namespace std;

// 100.00 %
class Solution {
public:
    string addBinary(string a, string b) {
        reverse(a.begin(), a.end());
        reverse(b.begin(), b.end());
        string res = "0";
        for ( int i = 0 ; ; i ++ ) {
            if( a.size() <= i && b.size() <= i ) {
            	reverse(res.begin(), res.end());
            	if ( res[0] == '0' ) res = res.substr(1);
                return res;
            }
            else if( a.size() <= i ) {
            	res += ( res[i] - '0' + b[i] -'0' ) / 2 +'0';
                res[i] = ( res[i] - '0' + b[i] -'0' ) % 2 +'0';
            }
            else if ( b.size() <= i ) {
            	res += ( res[i] - '0' + a[i] -'0' ) / 2 +'0';
                res[i] = ( res[i] - '0' + a[i] -'0' ) % 2 +'0';
            } else {
            	res += ( res[i] - '0' + a[i] -'0' + b[i] -'0' ) / 2 +'0';
                res[i] = ( res[i] - '0' + a[i] -'0' + b[i] -'0' ) % 2 +'0';
            }
        }
    }
};

int main() {
    string a = "0", b = "0";
    cout << Solution().addBinary(a, b) << endl;
    return 0;
}
